package com.vishnu.core.annonymousInnerClassPractice;

public class Test {

	public static void main(String[] args) {
		Popcorn p=new Popcorn(){
			public void taste(){
				System.out.println("worst taste");
			}
		};
		p.taste();
		System.out.println("p="+p.getClass().getName());
/* here we are creating child class for popcorn class and for that child class we are 
		creating object with parent class popcorn reference.*/ 
		

		
	   Popcorn p1=new Popcorn();
	   p1.taste();
	   System.out.println("p1="+p1.getClass().getName());
	   Popcorn p2=new Popcorn(){
		 public void taste(){
			 System.out.println("sweety....");
		 }
		   
	   };
	   p2.taste();
	   System.out.println("p2="+p2.getClass().getName());
		
	}
	
}
